<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Runner::Formatter::ProfileFormatter</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Runner::Formatter::ProfileFormatter</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../../files/vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter_rb.html">
                vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="ProgressBarFormatter.html">
                ProgressBarFormatter
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000488">example_passed</a>&nbsp;&nbsp;
      <a href="#M000487">example_started</a>&nbsp;&nbsp;
      <a href="#M000490">method_missing</a>&nbsp;&nbsp;
      <a href="#M000485">new</a>&nbsp;&nbsp;
      <a href="#M000486">start</a>&nbsp;&nbsp;
      <a href="#M000489">start_dump</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000485" class="method-detail">
        <a name="M000485"></a>

        <div class="method-heading">
          <a href="#M000485" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(options, where)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000485-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000485-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb, line 8</span>
 8:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">where</span>)
 9:           <span class="ruby-keyword kw">super</span>
10:           <span class="ruby-ivar">@example_times</span> = []
11:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000488" class="method-detail">
        <a name="M000488"></a>

        <div class="method-heading">
          <a href="#M000488" class="method-signature">
          <span class="method-name">example_passed</span><span class="method-args">(example)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000488-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000488-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb, line 21</span>
21:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">example_passed</span>(<span class="ruby-identifier">example</span>)
22:           <span class="ruby-keyword kw">super</span>
23:           <span class="ruby-ivar">@example_times</span> <span class="ruby-operator">&lt;&lt;</span> [
24:             <span class="ruby-identifier">example_group</span>.<span class="ruby-identifier">description</span>,
25:             <span class="ruby-identifier">example</span>.<span class="ruby-identifier">description</span>,
26:             <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@time</span>
27:           ]
28:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000487" class="method-detail">
        <a name="M000487"></a>

        <div class="method-heading">
          <a href="#M000487" class="method-signature">
          <span class="method-name">example_started</span><span class="method-args">(example)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000487-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000487-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb, line 17</span>
17:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">example_started</span>(<span class="ruby-identifier">example</span>)
18:           <span class="ruby-ivar">@time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
19:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000490" class="method-detail">
        <a name="M000490"></a>

        <div class="method-heading">
          <a href="#M000490" class="method-signature">
          <span class="method-name">method_missing</span><span class="method-args">(sym, *args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000490-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000490-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb, line 45</span>
45:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
46:           <span class="ruby-comment cmt"># ignore</span>
47:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000486" class="method-detail">
        <a name="M000486"></a>

        <div class="method-heading">
          <a href="#M000486" class="method-signature">
          <span class="method-name">start</span><span class="method-args">(count)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000486-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000486-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb, line 13</span>
13:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">count</span>)
14:           <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Profiling enabled.&quot;</span>
15:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000489" class="method-detail">
        <a name="M000489"></a>

        <div class="method-heading">
          <a href="#M000489" class="method-signature">
          <span class="method-name">start_dump</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000489-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000489-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb, line 30</span>
30:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_dump</span>
31:           <span class="ruby-keyword kw">super</span>
32:           <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\n\nTop 10 slowest examples:\n&quot;</span>
33:           
34:           <span class="ruby-ivar">@example_times</span> = <span class="ruby-ivar">@example_times</span>.<span class="ruby-identifier">sort_by</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">description</span>, <span class="ruby-identifier">example</span>, <span class="ruby-identifier">time</span><span class="ruby-operator">|</span>
35:             <span class="ruby-identifier">time</span>
36:           <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">reverse</span>
37:           
38:           <span class="ruby-ivar">@example_times</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">9</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">description</span>, <span class="ruby-identifier">example</span>, <span class="ruby-identifier">time</span><span class="ruby-operator">|</span>
39:             <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">red</span>(<span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%.7f&quot;</span>, <span class="ruby-identifier">time</span>))
40:             <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; #{description} #{example}&quot;</span>
41:           <span class="ruby-keyword kw">end</span>
42:           <span class="ruby-ivar">@output</span>.<span class="ruby-identifier">flush</span>
43:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>